package www.dashu.com.dao;

import www.dashu.com.dao.base.BaseDao;
import www.dashu.com.domain.CProductCategory;
import www.dashu.com.domain.SysPermission;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface CProductCategoryDao extends BaseDao<CProductCategory,Long> {

    @Query(value = "select o from CProductCategory o where o.id =:id")
    List<CProductCategory> getCProductCategoryById(@Param("id") Long id);

    @Modifying
    @Query(value = "delete from CProductCategory o where o.id = ?1")
    void deleteCProductCategoryById(Long id);

    @Query(value = "select o from CProductCategory o order by o.orderNum asc")
    List<CProductCategory> findAllSort();

}